#region License
// /* **************************************************************
// * Copyright (C) intex Consulting GmbH - All Rights Reserved    *
// *--------------------------------------------------------------*
// * Unauthorized copying of this file, via any medium is         *
// * strictly prohibited                                          *
// *--------------------------------------------------------------*
// * Proprietary and confidential                                 *
// *--------------------------------------------------------------*
// * Dissasembling/modifications strictly prohibited!             *
// ***************************************************************/
#endregion

using System;
using System.Collections.Generic;
using System.Linq;

namespace ComHlp.ContentClasses.VirtualControls.LView
{
    public class ItxListViewContainer : ICloneable
    {
        // <summary> display any listview (yes/no) </summary>
        public bool Display { get; set; }

        // <summary> every listview </summary>
        public List<ItxListView> ListViews { get; private set; }


        /// <summary> Default constructor </summary>
        public ItxListViewContainer()
        {
            ListViews = new List<ItxListView>();
            Display = true;
        }

        object ICloneable.Clone() { return Clone(); }

        private ItxListViewContainer Clone()
        {
            ItxListViewContainer itxListViewContainer = MemberwiseClone() as ItxListViewContainer;
            if (itxListViewContainer == null)
                return null;

            List<ItxListView> clonedListviews = new List<ItxListView>(itxListViewContainer.ListViews.Count);
            if (itxListViewContainer.ListViews.Count > 0)
                clonedListviews.AddRange(itxListViewContainer.ListViews.Select(column => column.Clone()));
            itxListViewContainer.ListViews = clonedListviews;

            return itxListViewContainer;
        }
    }
}